﻿<cfsilent>
	<cfscript>
		
		event.setArg("pageTitle", "教学任务安排 - 小语种外语课");
		
		termId = event.getArg("TermID");
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		courseId = event.getArg("CID");
		teacherId = event.getArg("TCHID");
		teacherName = event.getArg('TNAME','未指定');
		
		currentTab = event.getArg("TabID", "labCourse");
		
		sql = "SELECT 
					t_course.cid, 
					t_course.course_name, 
					t_course.course_credit, 
					t_course.period_week, 
					t_course.period, 
					t_course.period_theory, 
					t_course.period_practice, 
					t_course.course_code, 
					(SELECT COUNT(*) FROM t_reopen_task WHERE t_reopen_task.term_id = :termId AND t_course.cid = t_reopen_task.cid) countOpenTask 
				FROM 
					t_course 
				WHERE 
					(t_course.cat_id = 'B1')
					AND 
					t_course.abandon = '0' 
			   ORDER BY 
					t_course.cat_id, t_course.course_name ";
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		rs_course = queryObj.execute( sql=sql ).getResult(); 

		taskCount = 0;
		
		for ( i=1; i LTE rs_course.recordCount; i++ ){
			taskCount += rs_course["countOpenTask"][i];
		}
		
		targetArgs = structNew();
		
		rs_courseEntity = queryNew("cat_id");
		rs_clsroomType = queryNew("cr_type");
		rs_campus = queryNew("campus_id");
		
		if ( len(courseId) ) {
			
			currentTab = event.getArg("TabID", "labTaskDetail");
			
			sql = "SELECT 
						t_course.cid, 
						t_institute.institute_name, 
						t_course.course_name, 
						t_course.period, 
						t_course.period_theory, 
						t_course.period_practice, 
						t_course.period_computer, 
						t_course.course_credit, 
						t_course.period_week 
					FROM 
						t_course 
						INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
					WHERE 
						t_course.cid = :courseId ";
			queryObj = new query( datasource=application.dnsSlave );
			queryObj.addParam( name="courseId", value=courseId, cfsqltype="cf_sql_varchar" );
			rs_courseEntity = queryObj.execute( sql=sql ).getResult();
		
			sql = "SELECT 
						t_reopen_task.tsk_id, 
						t_reopen_task.cidx, 
						t_teacher.tch_id, 
						t_reopen_task.task_limite, 
						t_reopen_task.task_chooesd,  
						t_reopen_task.task_week, 
						t_reopen_task.task_period, 
						t_teacher.tch_name, 
						t_reopen_task.cr_type, 
						t_reopen_task.campus_id,  
						t_reopen_task.task_desc 
					FROM 
						t_reopen_task 
						INNER JOIN t_teacher ON t_teacher.tch_id = t_reopen_task.tch_id 
					WHERE 
						t_reopen_task.term_id = :termId  
						AND 
						t_reopen_task.cid = :courseId ";
			queryObj = new query( datasource=application.dnsSlave );
			queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="courseId", value=courseId, cfsqltype="cf_sql_varchar" );
			rs_taskEntity = queryObj.execute( sql=sql ).getResult(); 
		
			if ( rs_taskEntity.recordCount GT 0 ) {
				structInsert( targetArgs, "TaskID", rs_taskEntity.tsk_id, true );
			}
			
			sql = "SELECT cr_type, cr_type_name 
					FROM t_classroom_type 
					ORDER BY cr_type ";
			queryObj = new query( datasource=application.dnsSlave );
			rs_clsroomType = queryObj.execute( sql=sql ).getResult();
				
			sql = "SELECT campus_id, campus_name 
					FROM t_campus 
					ORDER BY campus_id ";
			queryObj = new query( datasource=application.dnsSlave );
			rs_campus = queryObj.execute( sql=sql ).getResult();
		
		}
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('DEFAULT_EVENT')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">教学任务安排</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 application"></i>小语种教学任务
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labCourse">class="active"</cfif> id="labCourse" tabTarget="Course">课程开设情况</span>
						<cfif len(courseId)>
							<span <cfif currentTab eq "labTaskDetail">class="active"</cfif> id="labTaskDetail" tabTarget="TaskDetail"><cfif rs_taskEntity.recordCount EQ 0>开设教学任务<cfelse>修改教学任务</cfif></span>
						</cfif>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="Course" class="tabContent">
					
					<div class="noticeBlock">
						<h3>小语种课程开设情况</h3>
						<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 已计划开设 <em><cfoutput>#taskCount#</cfoutput></em> 个小语种授课班级.</p>
						<hr/>
					</div>
				
					<cfif rs_course.recordCount>
						
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="18"></td>
									<td>课程</td>
									<td width="100">课程号</td>
									<td width="25">学分</td>
									<td width="70">排课周学时</td>
									<td width="40">总学时</td>
									<td width="50">理论学时</td>
									<td width="50">实践学时</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
                                <cfloop query="rs_course">
									<cfset row++ />
									<cfset structInsert(targetArgs, "CID", rs_course.cid, true) />
									<tr class="editRows" rowid="<cfoutput>#rs_course.cid#</cfoutput>">
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_course.course_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_course.course_code#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#numberFormat(rs_course.course_credit, '_.__')#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_course.period_week#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_course.period#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_course.period_theory#</cfoutput></span></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_course.period_practice#</cfoutput></span></td>
										<td><a href="<cfoutput>#buildURL('languageTask', targetArgs)#</cfoutput>" class="stat <cfif rs_course.countOpenTask gt 0>running<cfelse>stop</cfif>"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
						<cfelse>
						
						<div class="systemNotice">
							<p>课程代码库中未设置任何小语种课程, 请正确设置小语种课程的课程类别</p>
						</div>
						
					</cfif>
					
				</div>
				
				<cfif len(courseId) >
					
					<div id="TaskDetail" class="tabContent">
						
						<div class="noticeBlock">
							<h3>《
								<cfoutput>#rs_courseEntity.course_name#</cfoutput>
								》 任课单位:
								<cfoutput>#rs_courseEntity.institute_name#</cfoutput>
							</h3>
							<p><span class="img icon16x16 message"></span>总学时 <em>
								<cfoutput>#rs_courseEntity.period#</cfoutput>
								</em>, 其中理论学时<em>
								<cfoutput>#rs_courseEntity.period_theory#</cfoutput>
								</em>, 实践学时<em>
								<cfoutput>#rs_courseEntity.period_practice#</cfoutput>
								</em>, 上机学时<em>
								<cfoutput>#rs_courseEntity.period_computer#</cfoutput>
								</em>. 课程总学分:<em>
								<cfoutput>#numberFormat(rs_courseEntity.course_credit, '_.00')#</cfoutput>
								</em></p>
							<hr/>
						</div>
						
						<cfif rs_taskEntity.recordCount EQ 0>
								
								<div id="formBox">

									<form id="formCreate" onSubmit="javascript:return processCreate();" class="formWrapper" method="post" action="<cfoutput>#buildURL('languageTaskCreateDo')#</cfoutput>">
								
										<input type="hidden" name="CourseID" value="<cfoutput>#rs_courseEntity.cid#</cfoutput>" />
										<input type="hidden" name="TermID" value="<cfoutput>#termId#</cfoutput>" />
										<input type="hidden" id="TeacherID" name="TeacherID" value="<cfoutput>#teacherId#</cfoutput>" />
										<input type="hidden" name="TaskCount" value="1" />

										<div class="label">
											<span class="req">*</span><b>计划人数</b>
											<input name="PlanSize" type="text" class="typeSmallInt" verification="integer" maxlength="5" value="" />
										</div>
										
										<hr/>
										
										<div class="label">
											<b>排课教室类别</b>
											<select name="ClassroomType">
												<cfloop query="rs_clsroomType">
                                                    <option value="<cfoutput>#rs_clsroomType.cr_type#</cfoutput>"><cfoutput>#rs_clsroomType.cr_type_name#</cfoutput></option>
                                                </cfloop>
											</select>
										</div>
										
										<div class="label">
											<b>上课校区</b>
											<select name="CampusID">
												<cfloop query="rs_campus">
                                                    <option value="<cfoutput>#rs_campus.campus_id#</cfoutput>"><cfoutput>#rs_campus.campus_name#</cfoutput></option>
                                                </cfloop>
											</select>
										</div>
										
										<div class="label">
											<b>排课设置</b> 
											<!--- 根据课程周学时 设置排课要求 --->
											<cfswitch expression="#rs_courseEntity.period_week#">
												<cfcase value="0">
													<p>不排课</p>
													<input name="TaskPeriod" type="hidden" value="0" />
													<input name="WeekStart" type="hidden" value="1" />
													<input name="WeekEnd" type="hidden" value="16" />
												</cfcase>
												<cfcase value="2">
													<p>每周一次课, 安排2小节</p>
													<input name="TaskPeriod" type="hidden" value="2" />
												</cfcase>
												<cfcase value="3">
													<p>每周一次课, 安排3小节</p>
													<input name="TaskPeriod" type="hidden" value="3" />
												</cfcase>
												<cfcase value="4">
													<p>
														<input name="TaskPeriod" type="radio" class="typeRadio" checked="checked" value="2+2" />
														每周两次课, 每次2小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="4" />
														每周一次课, 连续4小节
													</p>
												</cfcase>
												<cfcase value="5">
													<p>
														<input name="TaskPeriod" type="radio" class="typeRadio" checked="checked" value="3+2" />每周两次课, 一次2小节,一次3小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="5" />每周一次课, 连续5小节
													</p>
												</cfcase>
												<cfcase value="6">
													<p>
														<input name="TaskPeriod" type="radio" class="typeRadio" checked="checked" value="3+3" />每周两次课, 每次3小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="4+2" />每周两次课, 一次4小节, 一次2小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="2+2+2" />每周三次课, 每次2小节
													</p>
												</cfcase>
												<cfcase value="8">
													<p>
														<input name="TaskPeriod" type="radio" class="typeRadio" checked="checked" value="3+3+2" />每周三次课, 两次3小节, 一次2小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="2+2+2+2" />每周四次课, 每次2小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="4+4" />每周两次课, 每次4小节
													</p>
												</cfcase>
												<cfcase value="10">
													<p>
														<input name="TaskPeriod" type="radio" class="typeRadio" checked="checked" value="3+3+2+2" />
														每周四次课, 两次3小节, 两次2小节
														<input name="TaskPeriod" type="radio" class="typeRadio" value="2+2+2+2+2" />
														每周五次课, 每次2小节
													</p>
												</cfcase>
												<cfcase value="16">
													<p>每周四次课, 两次4小节</p>
													<input name="TaskPeriod" type="hidden" value="4+4+4+4" />
												</cfcase>
											</cfswitch>
											
											<cfif rs_courseEntity.period_week gt 0>
												
												<cfset howmanyWeeks = round(0.4+rs_courseEntity.period_theory / rs_courseEntity.period_week) />
												<cfset weekArray = [] />
												
												<div class="secondRow">
													<div class="UIBottonRow">
														<i>课程周次单元</i>
														<cfswitch expression="#howmanyWeeks#">
															<cfcase value="4">
															<cfloop list="1,5,9,13" index="start">
																<cfset arrayAppend(weekArray, [start, (start+howmanyWeeks-1)]) />
																<a href="javascript:changeWeek(<cfoutput>#start#</cfoutput>,<cfoutput>#(start+howmanyWeeks-1)#</cfoutput>);"><cfoutput>#start#</cfoutput>-<cfoutput>#(start+howmanyWeeks-1)#</cfoutput></a>
															</cfloop>
															<!--- 特殊情况 用于春节、国庆时长调整 --->
															<cfif academicTerm eq "1">
																<cfloop list="4,8,12" index="start">
																	<a href="javascript:changeWeek(<cfoutput>#start#</cfoutput>,<cfoutput>#(start+howmanyWeeks-1)#</cfoutput>);"><cfoutput>#start#</cfoutput>-<cfoutput>#(start+howmanyWeeks-1)#</cfoutput></a>
																</cfloop>
															</cfif>
															</cfcase>
															<cfcase value="8">
															<cfloop list="1,5,9" index="start">
																<cfset arrayAppend(weekArray, [start, (start+howmanyWeeks-1)]) />
																<a href="javascript:changeWeek(<cfoutput>#start#</cfoutput>,<cfoutput>#(start+howmanyWeeks-1)#</cfoutput>);"><cfoutput>#start#</cfoutput>-<cfoutput>#(start+howmanyWeeks-1)#</cfoutput></a>
															</cfloop>
															<!--- 特殊情况 用于春节、国庆时长调整 --->
															<cfif academicTerm eq "1">
																<cfloop list="4,8" index="start">
																	<a href="javascript:changeWeek(<cfoutput>#start#</cfoutput>,<cfoutput>#(start+howmanyWeeks-1)#</cfoutput>);"><cfoutput>#start#</cfoutput>-<cfoutput>#(start+howmanyWeeks-1)#</cfoutput></a>
																</cfloop>
															</cfif>
															</cfcase>
															<cfcase value="10,11,12,14">
															<cfloop list="1,5" index="start">
																<cfset arrayAppend(weekArray, [start, (start+howmanyWeeks-1)]) />
																<a href="javascript:changeWeek(<cfoutput>#start#</cfoutput>,<cfoutput>#(start+howmanyWeeks-1)#</cfoutput>);"><cfoutput>#start#</cfoutput>-<cfoutput>#(start+howmanyWeeks-1)#</cfoutput></a>
															</cfloop>
															<!--- 特殊情况 用于春节、国庆时长调整 --->
															<cfif academicTerm eq "1">
																<cfloop list="4" index="start">
																	<a href="javascript:changeWeek(<cfoutput>#start#</cfoutput>,<cfoutput>#(start+howmanyWeeks-1)#</cfoutput>);"><cfoutput>#start#</cfoutput>-<cfoutput>#(start+howmanyWeeks-1)#</cfoutput></a>
																</cfloop>
															</cfif>
															</cfcase>
															<cfcase value="16">
															<cfset arrayAppend(weekArray, [1, 16]) />
															<a href="javascript:changeWeek(1,16);">1-16</a> <a href="javascript:changeWeek(5,19);">5-19</a> 
															<!--- 特殊情况 用于春节、国庆时长调整 --->
															<cfif academicTerm eq "1">
																<a href="javascript:changeWeek(4,19);">4-19</a>
															</cfif>
															</cfcase>
															<cfdefaultcase>
															<cfset arrayAppend(weekArray, [1, howmanyWeeks]) />
															</cfdefaultcase>
														</cfswitch>
														<a href="javascript:changeWeekSet(1);">顺延1周</a> <a href="javascript:changeWeekSet(-1);">提前1周</a>
													</div>
												</div>
												
												<div class="secondRow">
											
													<cfif arrayLen(weekArray) gt 1>
															<cfset randWeek = weekArray[randRange(1, arrayLen(weekArray))] />
														<cfelse>
															<cfset randWeek = weekArray[1] />
													</cfif>
													起始周
													<input name="WeekStart" id="WeekStart" type="text" class="typeTinyInt" verification="integer" maxlength="2" value="<cfoutput>#randWeek[1]#</cfoutput>" />
													结束周
													<input name="WeekEnd" id="WeekEnd" type="text" class="typeTinyInt" verification="integer" maxlength="2" value="<cfoutput>#randWeek[2]#</cfoutput>" />
												</div>
												
												<script language="javascript" type="text/javascript">
													//<![CDATA[
													<!--
													function changeWeekSet(offset) {
												
														var start = parseInt($("#WeekStart").val()) + offset;
														var end = parseInt($("#WeekEnd").val()) + offset;
											
														if (start > 0 && start < 16) { $("#WeekStart").val(start); }
														if (end < 19 && end > 0) { $("#WeekEnd").val(end); }
														if (end < start) { $("#WeekEnd").val(start); }											
											
														return void(0);
													}
											
													function changeWeek(start, end) {
											
														$("#WeekStart").val(start);
														$("#WeekEnd").val(end);
											
														return void(0);
													}
													// -->
													//]]>
												</script>
												
											</cfif>
										</div>
										
										<div class="label">
											<b>主讲教师</b>
											<input name="TeacherName" id="TeacherName" type="text" disabled="disabled" class="typeTextDynamic " verification="required" value="<cfoutput>#teacherName#</cfoutput>" /><span id="teacherTrigger" class="btnSearch"></span>
										</div>
										
										<div class="label">
											<b>排课要求</b>
											<textarea name="Describe" id="Describe"><cfoutput>#event.getArg('Describe')#</cfoutput></textarea>
										</div>
										
										<hr/>
										
										<div class="lable">
											<input class="button" type="submit" value="建立教学班" />
										</div>
										
									</form>

								</div>
								
								<script language="javascript" type="text/javascript">
									//<![CDATA[
									<!--
									function processCreate() {
										
										var teacherID = $("#TeacherID").val();
										
										if (teacherID != "") {
											return processVerfiyForm('formCreate');
										}
										else {
											alert("请先指定任课教师");
									
											$("#formBox").addClass("hidden_elem");
											$("#teacherBox").removeClass("hidden_elem");
									
											return false;
										}
									}
									
									$(document).ready(function() {
								
										$("#teacherTrigger").click(function(){

											$("#formBox").addClass("hidden_elem");
											$("#teacherBox").removeClass("hidden_elem");

										});
									
									});
									// -->
									//]]>
								</script>
								
							<cfelse>
								
								<div id="updateBox">
									
									<form id="formUpdate" onSubmit="javascript:return processVerfiyForm('formUpdate');" class="formWrapper" method="post" action="<cfoutput>#buildURL('languageTaskUpdateDo')#</cfoutput>">
										
										<input name="TaskID" type="hidden" value="<cfoutput>#rs_taskEntity.tsk_id#</cfoutput>" />
										<input id="TeacherIDUpdate" name="TeacherID" type="hidden" value="<cfoutput>#rs_taskEntity.tch_id#</cfoutput>" />
										
										<div class="label">
											<span class="req">*</span><b>计划人数</b>
											<input name="PlanSize" type="text" class="typeSmallInt" verification="integer" maxlength="5" value="<cfoutput>#rs_taskEntity.task_limite#</cfoutput>" />
											<span>实际选课人数 <strong><cfoutput>#rs_taskEntity.task_chooesd#</cfoutput></strong></span>
										</div>
							
										<div class="label">
											<b>周次安排</b>
											<div class="secondRow">
									
												<cfset weekPlan = listToArray(rs_taskEntity.task_week, "-") />
									
												起始周 <input name="WeekStart" type="text" class="typeTinyInt" verification="integer" maxlength="2" value="<cfoutput>#weekPlan[1]#</cfoutput>" />
												结束周 <input name="WeekEnd" type="text" class="typeTinyInt" verification="integer" maxlength="2" value="<cfoutput>#weekPlan[2]#</cfoutput>" />
										
												周学时 <input name="TaskPeriod" type="text" class="typeSmallInt" verification="required" value="<cfoutput>#rs_taskEntity.task_period#</cfoutput>" />
									
											</div>
										</div>
										
										<div class="label">
											<b>主讲教师</b>
											<input name="TeacherName" id="TeacherNameUpdate" type="text" disabled="disabled" class="typeTextDynamic " verification="required" value="<cfoutput>#rs_taskEntity.tch_name#</cfoutput>(<cfoutput>#rs_taskEntity.tch_id#</cfoutput>)" /><span id="teacherUpdateTrigger" class="btnSearch"></span>
										</div>
							
										<hr/>
							
										<div class="label">
											<b>排课教室类别</b>
											<select name="ClassroomType">
												<cfloop query="rs_clsroomType">
													<option <cfif rs_taskEntity.cr_type eq rs_clsroomType.cr_type>selected="selected"</cfif> value="<cfoutput>#rs_clsroomType.cr_type#</cfoutput>"><cfoutput>#rs_clsroomType.cr_type_name#</cfoutput></option>
												</cfloop>
											</select>
										</div>
							
										<div class="label">
											<b>上课校区</b>
											<select name="CampusID" >
												<cfloop query="rs_campus">
													<option <cfif rs_taskEntity.campus_id eq rs_campus.campus_id>selected="selected"</cfif> value="<cfoutput>#rs_campus.campus_id#</cfoutput>"><cfoutput>#rs_campus.campus_name#</cfoutput></option>
												</cfloop>
											</select>
										</div>
							
										<div class="label">
											<b>排课要求</b>
											<textarea style="height:60px;" name="Describe"><cfoutput>#rs_taskEntity.task_desc#</cfoutput></textarea>
										</div>
							
										<hr/>
							
										<div class="lable">
											<input class="button1" type="submit" value="更新教学任务" />
											<a class="button2" href="<cfoutput>#buildURL('languageTaskRemoveDo', targetArgs)#</cfoutput>">删除教学班</a>
										</div>
							
									</form>
									
									<script language="javascript" type="text/javascript">
										//<![CDATA[
										<!--
							
										$(document).ready(function() {
								
											$("#teacherUpdateTrigger").click(function(){
		
												$("#updateBox").addClass("hidden_elem");
												$("#teacherBox").removeClass("hidden_elem");

											});
									
										});
										
										// -->
										//]]>
									</script>
										
								</div>
								
						</cfif>

						<div id="teacherBox" class="hidden_elem">
							
							<form id="formSearch" class="formWrapper Transparent" method="post">
								<div class="label">
									<b>教师姓名或职工号</b>
									<input name="Keywords" id="Keywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#event.getArg('Keywords')#</cfoutput>" />
								</div>
								<hr/>
								<div class="lable">
									<input class="button1" type="submit" value="搜索教师" />
									<input id="formSearchReset" class="button" type="button" value="返回" />
								</div>
							</form>
							
							<div id="formSearchResult" class="UICardTable"></div>
							
							<script language="javascript" type="text/javascript">
								//<![CDATA[
								<!--
								$("input#formSearchReset").click(function(){
								
									$("#formBox").removeClass("hidden_elem");
									$("#teacherBox").addClass("hidden_elem");
										
								});
									
								$("#formSearch").submit(function(){
										
									if (processVerfiyForm('formSearch')) {
									
										$.getJSON(
												'<cfoutput>#buildURL("getTeacherByKeywords")#</cfoutput>',
												{
													'Keywords': $("form#formSearch input#Keywords").val(),
													'seed': (new Date()).getTime()
												},
												function(data) {
																
													$div = $("div#formSearchResult").html("").removeClass("hidden_elem");
													$("form#formAuth").addClass("hidden_elem");
																
													for (var i=0; i<data.length; i++) {
													
																var $element = $("<dl><dt><a><i class='sex" + data[i][2] + "'></i><dd><h3>" + data[i][1] + " [" + data[i][3] + "]" + "</h3><p>(" + data[i][0] + ")</p></dd></a></dt></dl>");
																	
																$element
																	.attr({
																		'TeacherID' : data[i][0],
																		'TeacherName' : data[i][1]
																	})
																	.click(function(){
																			
																		var name = $(this).attr('TeacherName');
																		var id = $(this).attr('TeacherID');
																			
																		$("form#formCreate input#TeacherID").val(id);
																		$("form#formCreate input#TeacherName").val(name + "(" + id + ")");
																		
																		$("form#formUpdate input#TeacherIDUpdate").val(id);
																		$("form#formUpdate input#TeacherNameUpdate").val(name + "(" + id + ")");
																			
																		/* backForm */
																		$("#formBox").removeClass("hidden_elem");
																		$("#updateBox").removeClass("hidden_elem");
																		$("#teacherBox").addClass("hidden_elem");
																		
																	})
																	.appendTo($div);
																	
													}
																
												});
										
									}
								
									return false;
								});
									
								// -->
								//]]>
							</script>
									
						</div>
						
					</div>
					
				</cfif>

			</div>
		</li>
	</ul>
</div>
				
				
					